extends layout

block content
  div(id="app")
    .flex-jc-sb(style='border-bottom:1px solid #ccc;padding-bottom:10px')
      div
        .flex-ac
          span 选择运行环境 &emsp;
          label.flex-ac(for="serveType") 
            input(id="serveType" type="radio" value="local"  v-model='sdkData.serveType' name='本地' ) 
            span 本地
          label.flex-ac(for="serveType2") &emsp;
            input(id='serveType2' type="radio" value="online" v-model='sdkData.serveType' name='线上' ) 
            span 线上
        .flex-ac(style='margin-top:20px')
          span 当前安卓离线sdk 
          span(v-if='!sdkData.sdkName'  ref='androidSDK' )= androidSDK 
          span(v-else style='color:blue' ) {{sdkData.sdkName}} 
          span &emsp;
          input(name="path"  v-if='sdkData.serveType == "local"' v-model='sdkData.baseSDKPath' placeholder='选择文件时复制文件路径到这个输入框' style='width:230px' ) 
          input(type="file" name="files" @change='uploadSdkSelect($event,"sdkFilePath")'  accept=".zip" ) 
          .btn-reset(@click='createSdk("Android")') 更新安卓离线sdk
        .flex-ac(style='margin-top:20px')
          span 当前IOS离线sdk
          span(v-if='!sdkData.iosSdkName' ref='iosSDK' )= iosSDK 
          span(v-else style='color:blue' ) {{sdkData.iosSdkName}} 
          span &emsp;
          input(name="path" v-if='sdkData.serveType == "local"' v-model='sdkData.baseiosSDKPath' placeholder='选择文件时复制文件路径到这个输入框' style='width:230px' ) 
          input(type="file" name="files" @change='uploadSdkSelect($event,"sdkiosFilePath")'  accept=".zip" ) 
          .btn-reset(@click='createSdk("Ios")') 更新IOS离线sdk
      
      a(style='color:#fff;font-weight:bold' href='/help' target='_blank')
        .btn-reset  查看使用文档 
       
    .flex-jc-sb
      .left-box
        .top-title 项目名称
        .top-view.flex-ac.flex-jc-sb
          .btn-create(@click='createItem') 新建项目
          .btn-reset(@click='init') 刷新所有项目
        .bottom-list
          .list-item(:class="{active:item.projectName == acIndex}" v-for='(item, key) in leftData' :key='key' @click='selectItem(item)')
            .flex-ac.flex-jc-sb
              div {{item.projectName}}
              .flex-ac.flex-jc-sb
                span &emsp;
                .btn-create(@click='updateItem(item)') 编辑 
                span &emsp;
                .btn-delete(@click='deleteItem(item)') 删除
      .center-box(v-show='acIndex') 
        .top-title 项目详情
        .bottom-list(style='height:calc(54vh + 70px)' v-if='leftData[acIndex]' ) 
          div(style='margin-bottom:20px;word-break: break-all;')
            div( v-for='(item, key) in centerObj' :key='key')
              .list-item(v-if="leftData[acIndex][key]")
                div(v-if="item.type == 'link'") {{item.label}} : 
                  <a :href="leftData[acIndex][key]" target="_blank">{{leftData[acIndex][key]}}</a>
                div(v-else-if="item.type == 'select'") {{item.label}} : 
                  span 安卓: {{leftData[acIndex][key].Android ? "打包中" : "未打包"}}
                  span &emsp;
                  span Ios: {{leftData[acIndex][key].Ios ? "打包中" : "未打包"}}
                div(v-else) {{item.label}} : {{leftData[acIndex][key]}}
          .top-view.flex-ac.flex-jc-sb 
            .btn-create(@click='buildItem(leftData[acIndex],"Android")') 
              span {{leftData[acIndex].build.Android ?'安卓打包中':'打包Android'}} 
            .btn-create(@click='buildItem(leftData[acIndex],"Ios")') 
              span {{leftData[acIndex].build.Ios ?'Ios打包中':'打包Ios'}} 
            .btn-create(@click='resetBuild(leftData[acIndex])') 
              span 重置打包状态
          
      .right-box(v-show='acIndex')
        .top-title 项目状态
        .bottom-list(style='height:calc(54vh + 70px);word-break: break-all;' :ref="acIndex+'box'" ) 
          div(v-if='messageObj[acIndex] && messageObj[acIndex].length')
            .list-item(v-for='(item, index) in messageObj[acIndex]' :key='index') {{item}}
          div(v-else) 无打包记录
          
